import urllib2

def main(env):
	try:
		return [("append",urllib2.urlopen(env["static"]["cwIP_url"]).read()+" ")]
	except urllib2.URLError as err:
		if "[Errno 54]" in str(err) or "Error 403" in str(err):
			return [("messageBox",env["static"]["cwIP_connectionResetMessage"])]
		if "[Errno 8]" in str(err):
			return [("messageBox",env["static"]["cwIP_hostNameNotFoundMessage"])]
		raise err

